<script>
export default {
	onLaunch: function() {
		let storg = uni.getStorageSync('userInfo');
		if (!storg) {
			this.$tools.reLaunch('pages/login/login');
		}
		// #ifdef APP-PLUS
		plus.push.addEventListener(
			'click',
			function(msg) {
				uni.$emit('pushListen',{data:msg})
			},
			true
		);
		console.log(plus.push.getClientInfo().clientid,'----------')
		// 监听在线消息事件 
		plus.push.addEventListener(
			'receive',
			function(msg) {
				// plus.ui.alert(2);
				// plus.ui.alert("recevice:"+JSON.stringify(msg))
				// uni.showModal({
				// 	title: 'recevice', 
				// 	content: 'recevice:' + JSON.stringify(msg)
				// });
				uni.$emit('pushListen',{data:msg})
			},
			true
		);
		// this.iniPush()
		// #endif
		console.log('App Launch');
	},
	onShow: function() {
		console.log('App Show');
	},
	onHide: function() {
		console.log('App Hide');
	},
	methods: {
		iniPush() {}
	}
};
</script>

<style>
page {
	background: #ffffff;
}
@font-face {
	font-weight: normal;
	font-style: normal;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-family: 'iconfont'; /* project id 1670075 */
	src: url('https://at.alicdn.com/t/font_1769552_97fg4idxmae.ttf') format('truetype');
}
.icon {
	font-size: 40upx;
	color: #2fc25b;
	font-family: 'iconfont' !important;
}
/*每个页面公共css */
</style>
